<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs">
<head>
<title>std::formatter&lt;std::chrono::file_time&gt;</title>
<meta charset="UTF-8">
<meta name="generator" content="MediaWiki 1.21.2">
<link rel="shortcut icon" href="../../../../common/favicon.ico">
<link rel="stylesheet" href="../../../../common/ext.css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" href="../../../../common/site_modules.css">
<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}#toc{display:none}.editsection{display:none}
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-css:7:15cea3ec788a65b5187d4018eed543bf */</style>

<script src="../../../../common/startup_scripts.js"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"cpp/chrono/file_clock/formatter","wgTitle":"cpp/chrono/file clock/formatter","wgCurRevisionId":64116,"wgArticleId":12581,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Todo no example"],"wgBreakFrames":false,"wgPageContentLanguage":"zh","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"zh","wgMonthNames":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgMonthNamesShort":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgRelevantPageName":"cpp/chrono/file_clock/formatter","wgUserVariant":"zh","wgRestrictionEdit":[],"wgRestrictionMove":[]});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function(){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"justify":0,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":0,"showjumplinks":1,"shownumberswatching":1,"showtoc":0,"showtoolbar":1,"skin":"cppreference2","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":0,"watchdefault":0,"watchdeletion":0,
"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"variant":"zh","language":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"gadget-MathJax":1,"gadget-ColiruCompiler":1});;},{},{});mw.loader.implement("user.tokens",function(){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});;},{},{});
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-js:7:258d7cd6aa9aa67dee25e01fb6a9e505 */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
<style type="text/css">/*<![CDATA[*/
.source-cpp {line-height: normal;}
.source-cpp li, .source-cpp pre {
	line-height: normal; border: 0px none white;
}
/**
 * GeSHi Dynamically Generated Stylesheet
 * --------------------------------------
 * Dynamically generated stylesheet for cpp
 * CSS class: source-cpp, CSS id: 
 * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
 * (http://qbnz.com/highlighter/ and http://geshi.org/)
 * --------------------------------------
 */
.cpp.source-cpp .de1, .cpp.source-cpp .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
.cpp.source-cpp  {font-family:monospace;}
.cpp.source-cpp .imp {font-weight: bold; color: red;}
.cpp.source-cpp li, .cpp.source-cpp .li1 {font-weight: normal; vertical-align:top;}
.cpp.source-cpp .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
.cpp.source-cpp .li2 {font-weight: bold; vertical-align:top;}
.cpp.source-cpp .kw1 {color: #0000dd;}
.cpp.source-cpp .kw2 {color: #0000ff;}
.cpp.source-cpp .kw3 {color: #0000dd;}
.cpp.source-cpp .kw4 {color: #0000ff;}
.cpp.source-cpp .co1 {color: #909090;}
.cpp.source-cpp .co2 {color: #339900;}
.cpp.source-cpp .coMULTI {color: #ff0000; font-style: italic;}
.cpp.source-cpp .es0 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es1 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es2 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es3 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es4 {color: #008000; font-weight: bold;}
.cpp.source-cpp .es5 {color: #008000; font-weight: bold;}
.cpp.source-cpp .br0 {color: #008000;}
.cpp.source-cpp .sy0 {color: #008000;}
.cpp.source-cpp .sy1 {color: #000080;}
.cpp.source-cpp .sy2 {color: #000040;}
.cpp.source-cpp .sy3 {color: #000040;}
.cpp.source-cpp .sy4 {color: #008080;}
.cpp.source-cpp .st0 {color: #008000;}
.cpp.source-cpp .nu0 {color: #000080;}
.cpp.source-cpp .nu6 {color: #000080;}
.cpp.source-cpp .nu8 {color: #000080;}
.cpp.source-cpp .nu12 {color: #000080;}
.cpp.source-cpp .nu16 {color:#000080;}
.cpp.source-cpp .nu17 {color:#000080;}
.cpp.source-cpp .nu18 {color:#000080;}
.cpp.source-cpp .nu19 {color:#000080;}
.cpp.source-cpp .ln-xtra, .cpp.source-cpp li.ln-xtra, .cpp.source-cpp div.ln-xtra {background-color: #ffc;}
.cpp.source-cpp span.xtra { display:block; }

/*]]>*/
</style><!--[if lt IE 7]><style type="text/css">body{behavior:url("/mwiki/skins/cppreference2/csshover.min.htc")}</style><![endif]--></head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-cpp_chrono_file_clock_formatter skin-cppreference2 action-view cpp-page-template cpp-navbar">
        <!-- header -->
        <!-- /header -->
        <!-- content -->
<div id="cpp-content-base">
            <div id="content">
                <a id="top"></a>
                <div id="mw-js-message" style="display:none;"></div>
                                <!-- firstHeading -->
<h1 id="firstHeading" class="firstHeading"><span style="font-size:0.7em; line-height:130%">std::</span>formatter<span style="font-size:0.7em; line-height:130%">&lt;std::chrono::file_time&gt;</span></h1>
                <!-- /firstHeading -->
                <!-- bodyContent -->
                <div id="bodyContent">
                                        <!-- tagline -->
                    <div id="siteSub">来自cppreference.com</div>
                    <!-- /tagline -->
                                        <!-- subtitle -->
                    <div id="contentSub"><span class="subpages">&lt; <a href="../../../cpp.html" title="cpp">cpp</a>‎ | <a href="../../chrono.html" title="cpp/chrono">chrono</a>‎ | <a href="../file_clock.html" title="cpp/chrono/file clock">file clock</a></span></div>
                    <!-- /subtitle -->
                                                            <!-- bodycontent -->
                    <div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr"><div class="t-page-template" style="">
<p>
</p>
</div>
<div class="t-navbar" style=""><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../../../cpp.html" title="cpp"> C++</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em;">
<tr class="t-nv"><td colspan="5"> <a href="../../language.html" title="cpp/language">语言</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../header.html" title="cpp/header">标准库头文件</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../freestanding.html" title="cpp/freestanding"> 自立与有宿主实现</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../named_req.html" title="cpp/named req">具名要求</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../utility.html#.E8.AF.AD.E8.A8.80.E6.94.AF.E6.8C.81" title="cpp/utility">语言支持库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../concepts.html" title="cpp/concepts">概念库</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../error.html" title="cpp/error">诊断库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../utility.html" title="cpp/utility">工具库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../string.html" title="cpp/string">字符串库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="https://zh.cppreference.com/w/cpp/container" title="cpp/container">容器库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../iterator.html" title="cpp/iterator">迭代器库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../ranges.html" title="cpp/ranges"> 范围库</a> <span class="t-mark-rev t-since-cxx20">(C++20)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../algorithm.html" title="cpp/algorithm">算法库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../numeric.html" title="cpp/numeric">数值库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../io.html" title="cpp/io">输入/输出库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../locale.html" title="cpp/locale">本地化库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../regex.html" title="cpp/regex">正则表达式库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../atomic.html" title="cpp/atomic">原子操作库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../thread.html" title="cpp/thread">线程支持库</a> <span class="t-mark-rev t-since-cxx11">(C++11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../filesystem.html" title="cpp/filesystem">文件系统库</a> <span class="t-mark-rev t-since-cxx17">(C++17)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../../experimental.html" title="cpp/experimental">技术规范</a> </td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../../chrono.html" title="cpp/chrono">日期和时间工具</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../duration.html" title="cpp/chrono/duration"><span class="t-lines"><span>duration</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../time_point.html" title="cpp/chrono/time point"><span class="t-lines"><span>time_point</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../time_of_day.html" title="cpp/chrono/time of day"><span class="t-lines"><span>time_of_day</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../clock_time_conversion.html" title="cpp/chrono/clock time conversion"><span class="t-lines"><span>clock_time_conversion</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../clock_cast.html" title="cpp/chrono/clock cast"><span class="t-lines"><span>clock_cast</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 时钟</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../system_clock.html" title="cpp/chrono/system clock"><span class="t-lines"><span>system_clock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../steady_clock.html" title="cpp/chrono/steady clock"><span class="t-lines"><span>steady_clock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../high_resolution_clock.html" title="cpp/chrono/high resolution clock"><span class="t-lines"><span>high_resolution_clock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx11">(C++11)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../is_clock.html" title="cpp/chrono/is clock"><span class="t-lines"><span>is_clock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5">                                             </td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../utc_clock.html" title="cpp/chrono/utc clock"><span class="t-lines"><span>utc_clock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../tai_clock.html" title="cpp/chrono/tai clock"><span class="t-lines"><span>tai_clock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../gps_clock.html" title="cpp/chrono/gps clock"><span class="t-lines"><span>gps_clock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../file_clock.html" title="cpp/chrono/file clock"><span class="t-lines"><span>file_clock</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../local_t.html" title="cpp/chrono/local t"><span class="t-lines"><span>local_t</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 日历</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../day.html" title="cpp/chrono/day"><span class="t-lines"><span>day</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../month.html" title="cpp/chrono/month"><span class="t-lines"><span>month</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../year.html" title="cpp/chrono/year"><span class="t-lines"><span>year</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../weekday.html" title="cpp/chrono/weekday"><span class="t-lines"><span>weekday</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../operator_slash.html" title="cpp/chrono/operator slash"><span class="t-lines"><span>operator/</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../year_month_day.html" title="cpp/chrono/year month day"><span class="t-lines"><span>year_month_day</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../year_month_day_last.html" title="cpp/chrono/year month day last"><span class="t-lines"><span>year_month_day_last</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../year_month_weekday.html" title="cpp/chrono/year month weekday"><span class="t-lines"><span>year_month_weekday</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../year_month_weekday_last.html" title="cpp/chrono/year month weekday last"><span class="t-lines"><span>year_month_weekday_last</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../weekday_indexed.html" title="cpp/chrono/weekday indexed"><span class="t-lines"><span>weekday_indexed</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../weekday_last.html" title="cpp/chrono/weekday last"><span class="t-lines"><span>weekday_last</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../month_day.html" title="cpp/chrono/month day"><span class="t-lines"><span>month_day</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../month_day_last.html" title="cpp/chrono/month day last"><span class="t-lines"><span>month_day_last</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../month_weekday.html" title="cpp/chrono/month weekday"><span class="t-lines"><span>month_weekday</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../month_weekday_last.html" title="cpp/chrono/month weekday last"><span class="t-lines"><span>month_weekday_last</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../year_month.html" title="cpp/chrono/year month"><span class="t-lines"><span>year_month</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> 时区</td></tr>
<tr class="t-nv-col-table"><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../tzdb.html" title="cpp/chrono/tzdb"><span class="t-lines"><span>tzdb</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../tzdb_list.html" title="cpp/chrono/tzdb list"><span class="t-lines"><span>tzdb_list</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../tzdb_functions.html" title="cpp/chrono/tzdb functions"><span class="t-lines"><span>get_tzdb</span><span>get_tzdb_list</span><span>reload_tzdb</span><span>remote_version</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
</table></div></td><td><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../time_zone.html" title="cpp/chrono/time zone"><span class="t-lines"><span>time_zone</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../locate_zone.html" title="cpp/chrono/locate zone"><span class="t-lines"><span>locate_zone</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../current_zone.html" title="cpp/chrono/current zone"><span class="t-lines"><span>current_zone</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../zoned_time.html" title="cpp/chrono/zoned time"><span class="t-lines"><span>zoned_time</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../link.html" title="cpp/chrono/link"><span class="t-lines"><span>link</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="../leap.html" title="cpp/chrono/leap"><span class="t-lines"><span>leap</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div></td></tr>
</table></div></td></tr>
<tr class="t-nv-h2"><td colspan="5"> <a href="../c.html" title="cpp/chrono/c"> C 风格日期和时间</a></td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../file_clock.html" title="cpp/chrono/file clock"><tt>std::chrono::file_clock</tt></a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv-h1"><td colspan="5">成员函数</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="now.html" title="cpp/chrono/file clock/now"><span class="t-lines"><span>file_clock::now</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="to_from_sys.html" title="cpp/chrono/file clock/to from sys"><span class="t-lines"><span>file_clock::to_sys</span><span>file_clock::from_sys</span></span></a></div><div><span class="t-lines"><span><span class="t-mark">(仅若不提供 <code>to_utc</code> 和 <code>from_utc</code> 才提供)</span></span></span></div></div></td></tr>
<tr class="t-nv"><td colspan="5"> <br>
</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="to_from_utc.html" title="cpp/chrono/file clock/to from utc"><span class="t-lines"><span>file_clock::to_utc</span><span>file_clock::from_utc</span></span></a></div><div><span class="t-lines"><span><span class="t-mark">(仅若不提供 <code>to_sys</code> 和 <code>from_sys</code> 才提供)</span></span></span></div></div></td></tr>
<tr class="t-nv-h1"><td colspan="5">时间点 I/O</td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="operator_ltlt.html" title="cpp/chrono/file clock/operator ltlt"><span class="t-lines"><span>operator&lt;&lt;</span></span></a></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><strong class="selflink"><span class="t-lines"><span>formatter<span class="t-dsc-small">&lt;std::chrono::file_time&gt;</span></span></span></strong></div></div></td></tr>
<tr class="t-nv"><td colspan="5"><div class="t-nv-ln-table"><div><a href="from_stream.html" title="cpp/chrono/file clock/from stream"><span class="t-lines"><span>from_stream</span></span></a></div></div></td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div></div>
<table class="t-dcl-begin"><tbody>
<tr class="t-dsc-header">
<td> <div>定义于头文件 <code><a href="../../header/chrono.html" title="cpp/header/chrono">&lt;chrono&gt;</a></code>
 </div></td>
<td></td>
<td></td>
</tr>
<tr class="t-dcl">
<td class="t-dcl-nopad"> <div><span class="mw-geshi cpp source-cpp"><span class="kw1">template</span><span class="sy1">&lt;</span><span class="kw1">class</span> Duration, <span class="kw1">class</span> CharT<span class="sy1">&gt;</span><br>
<span class="kw1">struct</span> formatter<span class="sy1">&lt;</span>std<span class="sy4">::</span><span class="me2">chrono</span><span class="sy4">::</span><span class="me2">file_time</span><span class="sy1">&lt;</span>Duration<span class="sy1">&gt;</span>, CharT<span class="sy1">&gt;</span><span class="sy4">;</span></span></div></td>
<td class="t-dcl-nopad">  </td>
<td class="t-dcl-nopad">  </td>
</tr>
<tr class="t-dcl-sep"><td></td><td></td><td></td></tr>
</tbody></table>
<p><span class="t-lc">std::formatter</span> 的特化，定义 <span class="t-lc">std::chrono::file_time</span> 的格式化规则。
</p><p>若使用 <code>%Z</code> ，则将它替换成加宽到 <code>CharT</code> 的 <span class="t-c"><span class="mw-geshi cpp source-cpp"><span class="st0">"UTC"</span></span></span> 。若使用 <code>%z</code> 或其有修饰的变体，则将格式化 <code>0min</code> 的偏移。
格式化的日期和时间等价于对 <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">chrono</span><span class="sy4">::</span><span class="me2">clock_cast</span><span class="sy1">&lt;</span><a href="../system_clock.html"><span class="kw1004">std::<span class="me2">chrono</span><span class="sy4">::</span><span class="me2">system_clock</span></span></a><span class="sy1">&gt;</span><span class="br0">(</span>tp<span class="br0">)</span></span></span> 或 <span class="t-c"><span class="mw-geshi cpp source-cpp">std<span class="sy4">::</span><span class="me2">chrono</span><span class="sy4">::</span><span class="me2">clock_cast</span><span class="sy1">&lt;</span>std<span class="sy4">::</span><span class="me2">chrono</span><span class="sy4">::</span><span class="me2">utc_clock</span><span class="sy1">&gt;</span><span class="br0">(</span>tp<span class="br0">)</span></span></span> 所格式化者，其中 <code>tp</code> 表示格式化参数。
</p><p>通常不直接访问，但通过<a href="../../utility/format.html" title="cpp/utility/format">格式化函数</a>使用 <span class="t-lc">std::formatter</span> 特化。
</p>
<h3><span class="mw-headline" id=".E6.A0.BC.E5.BC.8F.E8.AF.B4.E6.98.8E">格式说明</span></h3>
<p>格式说明拥有形式
</p>
<table class="t-sdsc-begin">

<tr>
<td colspan="10" class="t-sdsc-sep">
</td></tr>
<tr class="t-sdsc">
<td class="t-sdsc-nopad"> <span class="t-spar">填充与对齐</span><span class="t-mark">(可选)</span> <span class="t-spar">宽度</span><span class="t-mark">(可选)</span> <span class="t-spar">精度</span><span class="t-mark">(可选)</span> <span class="t-spar">时间说明</span><span class="t-mark">(可选)</span>
</td>
<td class="t-sdsc-nopad">
</td>
<td class="t-sdsc-nopad">
</td></tr>



<tr>
<td colspan="10" class="t-sdsc-sep">
</td></tr></table>
<p><span class="t-spar">填充与对齐</span> 、 <span class="t-spar">宽度</span> 及 <span class="t-spar">精度</span> 拥有同<a href="../../utility/format/formatter.html#.E6.A0.87.E5.87.86.E6.A0.BC.E5.BC.8F.E8.AF.B4.E6.98.8E" title="cpp/utility/format/formatter">标准格式说明</a>中的含义。 <span class="t-spar">精度</span> 仅对表示类型 <code>Rep</code> 为浮点类型的 <span class="t-lc">std​::​chrono​::​duration</span> 类型合法，否则抛出 <span class="t-lc">std::format_error</span> 。
</p><p><span class="t-spar">时间说明</span> 由一或更多个转换说明符与通常字符（除了 <code>{</code> 、 <code>}</code> 与 <code>%</code> ）构成。 <span class="t-spar">时间说明</span> 必须始于一个转换说明符。写入所有通常字符到输出而不修改。每个无修饰的转换说明符始于 <code>%</code> 字符后随一个确定说明符行为的字符。某些转换说明符拥有修饰形式，其中 <code>E</code> 或 <code>O</code> 修饰字符插入到 <code>%</code> 字符后。按描述于下的方式以适合的字符替换每个转换说明符。
</p><p>若 <span class="t-spar">时间说明</span> 为空，则如同以<a href="operator_ltlt.html" title="cpp/chrono/file clock/operator ltlt">流化</a>时间对象到 <span class="t-c"><span class="mw-geshi cpp source-cpp"><a href="../../io/basic_stringstream.html"><span class="kw1737">std::<span class="me2">stringstream</span></span></a> os</span></span> 并复制 <span class="t-c"><span class="mw-geshi cpp source-cpp">os.<span class="me1">str</span><span class="br0">(</span><span class="br0">)</span></span></span> 到输出缓冲，附带按照每个格式说明符的填充和调整一般，格式化时间对象。
</p><p>下列格式说明符可用：
</p>
<table class="wikitable" style="font-size:85%; max-width:90em;">

<tr>
<th> 转换<br>说明符
</th>
<th> 解释
</th></tr>
<tr>
<th> <code>%%</code>
</th>
<td> 写字面的 <code>%</code> 字符。
</td></tr>
<tr>
<th> <code>%n</code>
</th>
<td> 写换行符。
</td></tr>
<tr>
<th> <code>%t</code>
</th>
<td> 写水平制表符。
</td></tr>
<tr>
<th colspan="3"> 年
</th></tr>
<tr>
<th> <code>%C</code> <br> <code>%EC</code>
</th>
<td> 写年除以 100 向下取整除的结果。若结果为单个十进制位，则前附 0 。
<p>修饰的命令 <code>%EC</code> 写本地环境的替用世纪表示。
</p>
</td></tr>
<tr>
<th> <code>%y</code> <br> <code>%Oy</code> <br> <code>%Ey</code>
</th>
<td> 写年的末二位十进制数。若结果为单个数位，则前附 0 。
<p>修饰的命令 <code>%Oy</code> 写本地环境的替用表示。
</p><p>修饰的命令 <code>%Ey</code> 写距 <code>%EC</code> 的偏移（仅年）的本地环境替用表示。
</p>
</td></tr>
<tr>
<th> <code>%Y</code> <br> <code>%EY</code>
</th>
<td> 按十进制数写年。若结果少于四位，则左填充 0 到四位。
<p>修饰的命令 <code>%EY</code> 写本地环境的替用完整年表示。
</p>
</td></tr>
<tr>
<th colspan="3"> 月
</th></tr>
<tr>
<th> <code>%b</code><br><code>%h</code>
</th>
<td> 写本地环境的缩写月名。
</td></tr>
<tr>
<th> <code>%B</code>
</th>
<td> 写本地环境的完整月名。
</td></tr>
<tr>
<th> <code>%m</code><br><code>%Om</code>
</th>
<td> 按十进制数写月份（一月为 <code>01</code> ）。若结果为单个数位，则前附 0 。
<p>修饰的命令 <code>%Om</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th colspan="3"> 日
</th></tr>
<tr>
<th> <code>%d</code><br><code>%Od</code>
</th>
<td> 按十进制数写月之日。若结果为单个十进制位，则前附 0 。
<p>修饰的命令 <code>%Od</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th> <code>%e</code><br><code>%Oe</code>
</th>
<td> 按十进制数写月之日。若结果为单个十进制位，则前附空格。
<p>修饰的命令 <code>%Oe</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th colspan="3"> 星期之日
</th></tr>
<tr>
<th> <code>%a</code>
</th>
<td> 写本地环境的缩写星期名。
</td></tr>
<tr>
<th> <code>%A</code>
</th>
<td> 写本地环境的完整星期名。
</td></tr>
<tr>
<th> <code>%u</code><br><code>%Ou</code>
</th>
<td> 按十进制数写 ISO 星期之日（ 1-7 ），其中星期一为 <code>1</code> 。
<p>修饰的命令 <code>%Ou</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th> <code>%w</code><br><code>%Ow</code>
</th>
<td> 写星期之日为十进制数（ 0-6 ），其中星期日为 <code>0</code> 。
<p>修饰的命令 <code>%Ow</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th colspan="3"> 基于 ISO 8601 星期的年
</th></tr>
<tr>
<td colspan="3">
<p>ISO 8601 星期始于星期一而年的第一星期必须满足下列要求：
</p>
<ul><li> 包含 1 月 4 日
</li><li> 包含该年的首个星期四
</li></ul>
</td></tr>
<tr>
<th> <code>%g</code>
</th>
<td> 写基于 ISO 8601 星期的年的后二位十进制数。若结果为单个数位，则前附 0 。
</td></tr>
<tr>
<th> <code>%G</code>
</th>
<td> 按十进制数写基于 ISO 8601 星期的年。若结果少于四位，则左填充 0 到四位。
</td></tr>
<tr>
<th> <code>%V</code><br><code>%OV</code>
</th>
<td> 按十进制数年的 ISO 8601 星期。若结果为单个数位，则前附 0 。
<p>修饰的命令 <code>%OV</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th colspan="3"> 年之星期/日
</th></tr>
<tr>
<th> <code>%j</code>
</th>
<td> 按十进制数写年的日（ 1 月 1 日为 <code>001</code> ）。若结果少于三位，则左填充 0 到三位。
</td></tr>
<tr>
<th> <code>%U</code><br><code>%OU</code>
</th>
<td> 按十进制数写年的星期数。该年的首个星期日为 01 星期的首日。同年中之前的日在 00 星期中。若结果为单个数位，则前附 0 。
<p>修饰的命令 <code>%OU</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th> <code>%W</code><br><code>%OW</code>
</th>
<td> 按十进制数写年的星期数。该年的首个星期一为 01 星期的首日。同年中之前的日在 00 星期中。若结果为单个数位，则前附 0 。
<p>修饰的命令 <code>%OW</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th colspan="3"> 日期
</th></tr>
<tr>
<th> <code>%D</code>
</th>
<td> 等价于 <code><b>"%m/%d/%y"</b></code> 。
</td></tr>
<tr>
<th> <code>%F</code>
</th>
<td> 等价于 <code><b>"%Y-%m-%d"</b></code> 。
</td></tr>
<tr>
<th> <code>%x</code><br><code>%Ex</code>
</th>
<td> 写本地环境的日期表示。
<p>修饰的命令 <code>%Ex</code> 产生本地环境的替用日期表示。
</p>
</td></tr>
<tr>
<th colspan="3"> 日之时间
</th></tr>
<tr>
<th> <code>%H</code><br><code>%OH</code>
</th>
<td> 按十进制数字写时（ 24 小时时钟）。若结果为单个数位，则前附 0 。
<p>修饰的命令 <code>%OH</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th> <code>%I</code><br><code>%OI</code>
</th>
<td> 按十进制数字写时（ 12 小时时钟）。若结果为单个数位，则前附 0 。
<p>修饰的命令 <code>%OI</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th> <code>%M</code><br><code>%OM</code>
</th>
<td> 按十进制数字写分。若结果为单个数位，则前附 0 。
<p>修饰的命令 <code>%OM</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th> <code>%S</code><br><code>%OS</code>
</th>
<td> 按十进制数字写秒。若结果为单个数位，则前附 0 。
<p>若输入的精度不能准确地以秒表示，则格式为 fixed 格式且精度匹配输入精度的十进制浮点数（或若不能在 18 位小数内转换到浮点数十进制秒，则为到微秒精度）。用作小数点的字符按照本地环境本地化。
</p><p>修饰的命令 <code>%OS</code> 写本地环境的替用表示。
</p>
</td></tr>
<tr>
<th> <code>%p</code>
</th>
<td> 写与 12 小时时钟相关的 AM/PM 设计的本地环境版本。
</td></tr>
<tr>
<th> <code>%R</code>
</th>
<td> 等价于 <code><b>"%H:%M"</b></code> 。
</td></tr>
<tr>
<th> <code>%T</code>
</th>
<td> 等价于 <code><b>"%H:%M:%S"</b></code> 。
</td></tr>
<tr>
<th> <code>%r</code>
</th>
<td> 写本地环境的 12 小时时钟时间。
</td></tr>
<tr>
<th> <code>%X</code><br><code>%EX</code>
</th>
<td> 写本地环境的时间表示。
<p>修饰的命令 <code>%EX</code> 写本地环境的替用时间表示。
</p>
</td></tr>
<tr>
<th colspan="3"> 杂项
</th></tr>
<tr>
<th> <code>%c</code><br><code>%Ec</code>
</th>
<td> 写本地环境的日期与时间表示。
<p>修饰的命令 <code>%Ec</code> 写本地环境的替用日期与时间表示。
</p>
</td></tr>
<tr>
<th> <code>%z</code><br><code>%Ez</code><br><code>%Oz</code>
</th>
<td> 以 ISO 8601 格式写自 UTC 的偏移。例如 <code>-0430</code> 表示 UTC 后 4 小时 30 分。若偏移为 0 ，则使用 <code>+0000</code> 。
<p>修饰的命令 <code>%Ez</code> 与 <code>%Oz</code> 在时与分间插入 <code>:</code> （例如 <code>-04:30</code> ）。
</p>
</td></tr>
<tr>
<th> <code>%Z</code>
</th>
<td> 写时区缩写。
</td></tr></table>
<h3><span class="mw-headline" id=".E7.A4.BA.E4.BE.8B">示例</span></h3>
<table class="metadata plainlinks ambox mbox-small-left ambox-notice" style=""><tr><td class="mbox-empty-cell"></td><td class="mbox-text" style="">本节未完成<br>原因：暂无示例 </td></tr></table>
<h3><span class="mw-headline" id=".E5.8F.82.E9.98.85">参阅</span></h3>
<table class="t-dsc-begin">

<tr class="t-dsc">
<td>  <div class="t-dsc-member-div"><div><a href="../../utility/format/format.html" title="cpp/utility/format/format"> <span class="t-lines"><span>format</span></span></a></div><div><span class="t-lines"><span><span class="t-mark-rev t-since-cxx20">(C++20)</span></span></span></div></div>
</td>
<td>  在新 string 中存储参数的格式化表示 <br> <span class="t-mark">(函数模板)</span> </td></tr>
</table>

<!-- 
NewPP limit report
Preprocessor visited node count: 5520/1000000
Preprocessor generated node count: 13985/1000000
Post‐expand include size: 254554/2097152 bytes
Template argument size: 28262/2097152 bytes
Highest expansion depth: 23/40
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key mwiki1-mwiki_zh_:pcache:idhash:12581-0!*!0!!*!*!zh!* and timestamp 20200310023228 -->
</div>                    <!-- /bodycontent -->
                                        <!-- printfooter -->
                    <div class="printfooter">
                    来自“<a href="https://zh.cppreference.com/mwiki/index.php?title=cpp/chrono/file_clock/formatter&amp;oldid=64116">https://zh.cppreference.com/mwiki/index.php?title=cpp/chrono/file_clock/formatter&amp;oldid=64116</a>”                    </div>
                    <!-- /printfooter -->
                                                            <!-- catlinks -->
                    <!-- /catlinks -->
                                                            <div class="visualClear"></div>
                    <!-- debughtml -->
                                        <!-- /debughtml -->
                </div>
                <!-- /bodyContent -->
            </div>
        </div>
        <!-- /content -->
        <!-- footer -->
        <div id="cpp-footer-base" class="noprint">
            <div id="footer">
                        <div id="cpp-navigation">
            <h5>导航</h5>
            <ul><li><a href="https://zh.cppreference.com/w/cpp/chrono/file_clock/formatter">Online version</a></li><li>Offline version retrieved 2020-03-14 18:00.</li></ul></div>
                        <ul id="footer-info">
                                    <li id="footer-info-lastmod"> 本页面最后修改于2020年1月28日 (星期二) 00:47。</li>
                                    <li id="footer-info-viewcount">此页面已被浏览过23次。</li>
                            </ul>
                    </div>
        </div>
        <!-- /footer -->
        <script>if(window.mw){
mw.loader.state({"site":"loading","user":"missing","user.groups":"ready"});
}</script>
<script src="../../../../common/skin_scripts.js"></script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.page.ready","mediawiki.searchSuggest","mediawiki.hidpi","ext.gadget.MathJax","ext.gadget.ColiruCompiler"], null, true);
}</script>
<script src="../../../../common/site_scripts.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2828341-1']);
_gaq.push(['_setDomainName', 'cppreference.com']);
_gaq.push(['_trackPageview']);
</script><!-- Served in 0.967 secs. -->
	</body>
<!-- Cached 20200310023228 -->
</html>